import java.util.Scanner;

class Dog extends Aminal{
    public Dog(String name, int age) {
        super(name, age);
    }

    public void eat(){
        System.out.println(this.name + " 在吃饭");
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}


class Aminal {
    public String name;
    public int age;

    public Aminal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println(this.name + " 在吃饭");
    }

    @Override
    public String toString() {
        return "Aminal{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}



public class Text {

    public static void main(String[] args) throws
            PossWordExcepption
            ,UserNameException {

        User user = new User();
        user.setUserName("admin");
        user.setPassWord("123");

//        Scanner sc = new Scanner(System.in);
//        System.out.println("请输入用户名:");
//        String userName = sc.nextLine();
//        System.out.println("请输入密码:");
//        String passWord = sc.toString();

        user.login("admin","13");

    }


    public static void show(Aminal aminal){
        System.out.println(aminal.toString());
    }

    public static void main1(String[] args) {
//        Aminal aminal = new Dog("旺财", 18);
//
//        aminal.eat();
//
//        System.out.println(aminal.toString());
//
//        show(new Dog("小黄",19));
//
//        Aminal aminal1 = show1();
//        System.out.println(aminal1.toString());

        Aminal aminal = new Dog("小黄",21);

        Dog dog = (Dog)aminal;

    }
}

